package com.hfy.user.controller;

import com.hfy.model.dto.UserDto;
import com.hfy.user.service.LoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import result.Result;

import javax.servlet.http.HttpServletRequest;

/**
 * @ author 韩
 * time: 2024/5/10 2:02
 */
@RestController
@Slf4j
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    public Result login(@RequestBody UserDto dto, HttpServletRequest request) {
        // 就不进行加盐处理了
        return loginService.login(dto, request);
    }
}
